package com.taobao.action;

import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;

import com.taobao.pojo.Config;
import com.taobao.pojo.Smaller;
import com.taobao.ui.widget.UpdateSmallerWidget;

public class PreUpdateSmallerAction extends CommonAction {

	@Override
    public void doAction(Object uiObject) {
        Table table = (Table) getData("source");
        TableItem[] items = table.getSelection();
        if (items != null && items.length > 0) {
            final Smaller smaller = (Smaller) items[0].getData();
            UpdateSmallerWidget updateSmallerWidget = (UpdateSmallerWidget) Config.uiContext.get(UpdateSmallerWidget.ID);
            updateSmallerWidget.fillWidget(smaller);
        }
    }

}
